package com.makemoney.miniprogram.modules.users.service;

import com.makemoney.miniprogram.modules.users.dto.IMyUserDetails;
import com.makemoney.miniprogram.modules.users.dto.LoginDTO;
import com.makemoney.miniprogram.modules.users.dto.TokenDTO;
import org.springframework.security.core.userdetails.UserDetails;

import javax.servlet.http.HttpServletRequest;

public interface IAuthorizeService {
    /**
     * 获取用户信息
     * @param username 用户账号
     * @return
     */
    IMyUserDetails loadUserByUsername(String username);

    /**
     * 登录
     * @param loginDTO
     * @return
     */
    TokenDTO login(LoginDTO loginDTO);
    boolean logout(IMyUserDetails userDetails);

    TokenDTO refreshToken(HttpServletRequest request);

    boolean hasPermission(UserDetails userDetails, String url);
}
